package com.common.www.bean.entity.sale;

//import com.bianmaba.realestate.bean.entity.authorization.UserRoleMiddle;

import org.springframework.boot.base.jpa.domain.annotations.QueryCacheable;
import org.springframework.boot.base.jpa.domain.entity.NumberIdentityEntity;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * 卖货点工厂
 *
 * @author luozisong
 */
@DynamicUpdate(true)
@DynamicInsert(true)
@Entity
@Getter
@Setter
@QueryCacheable
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@Table()
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "project返回参数")
public class SaleFactory extends NumberIdentityEntity {
    private static final long serialVersionUID = -2278084748058910042L;

    /**
     * 关联的收货单
     */
    @JsonIgnoreProperties(value = {"saleFactory"})
    //二级分类
    @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, mappedBy = "saleFactory")
    private List<SaleFactoryPrice> priceList;
    /**
     * 卖货点名称
     */
    @Column(length = 32)
    private String name;
    /**
     * 卖货点名称
     */
    @Column(length = 32)
    private String address;

    /**
     * 省份
     */
    @Column(length = 32)
    @ApiModelProperty(value = "省份", example = "四川省")
    private String province;
    /**
     * 城市
     */
    @Column(length = 32)
    @ApiModelProperty(value = "市", example = "成都市")
    private String city;
    /**
     * 城市编码
     */
    @Column(length = 12)
    private String code;

    /**
     * 地址的纬度,采用GCJ02坐标系为准
     */
    @Column(length = 15)
    private Double lat;
    /**
     * 地址的经度,采用GCJ02坐标系为准
     */
    @Column(length = 15)
    private Double lng;
}